<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员控制台 - 电影院管理系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f5f5;
            line-height: 1.6;
        }
        
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .nav {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        
        .logo {
            font-size: 24px;
            font-weight: bold;
        }
        
        .nav-links {
            display: flex;
            gap: 30px;
        }
        
        .nav-links a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: opacity 0.3s;
        }
        
        .nav-links a:hover {
            opacity: 0.8;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .welcome-section {
            background: white;
            padding: 30px;
            border-radius: 15px;
            margin-bottom: 30px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            text-align: center;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .stat-card {
            background: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            text-align: center;
            transition: transform 0.3s;
        }
        
        .stat-card:hover {
            transform: translateY(-5px);
        }
        
        .stat-icon {
            font-size: 48px;
            margin-bottom: 15px;
        }
        
        .stat-number {
            font-size: 32px;
            font-weight: bold;
            color: #333;
            margin-bottom: 5px;
        }
        
        .stat-label {
            color: #666;
            font-size: 16px;
        }
        
        .management-section {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin-bottom: 30px;
        }
        
        .section-title {
            font-size: 24px;
            color: #333;
            margin-bottom: 20px;
            border-bottom: 3px solid #667eea;
            padding-bottom: 10px;
        }
        
        .management-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
        }
        
        .management-card {
            border: 1px solid #e1e1e1;
            border-radius: 10px;
            padding: 25px;
            text-align: center;
            transition: transform 0.3s, box-shadow 0.3s;
        }
        
        .management-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        
        .management-icon {
            font-size: 48px;
            margin-bottom: 15px;
        }
        
        .management-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
        }
        
        .management-description {
            color: #666;
            margin-bottom: 20px;
            font-size: 14px;
        }
        
        .btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            font-size: 14px;
            font-weight: 500;
            transition: transform 0.2s;
        }
        
        .btn:hover {
            transform: translateY(-2px);
        }
        
        .btn-sm {
            padding: 6px 12px;
            font-size: 12px;
        }
        
        .recent-activities {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        .activity-list {
            list-style: none;
        }
        
        .activity-item {
            padding: 15px;
            border-bottom: 1px solid #e1e1e1;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .activity-item:last-child {
            border-bottom: none;
        }
        
        .activity-content {
            flex: 1;
        }
        
        .activity-title {
            font-weight: 500;
            color: #333;
            margin-bottom: 5px;
        }
        
        .activity-time {
            color: #666;
            font-size: 12px;
        }
        
        .activity-type {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
        }
        
        .type-user {
            background-color: #e3f2fd;
            color: #1976d2;
        }
        
        .type-order {
            background-color: #f3e5f5;
            color: #7b1fa2;
        }
        
        .type-system {
            background-color: #fff3e0;
            color: #f57c00;
        }
        
        .no-data {
            text-align: center;
            color: #666;
            font-style: italic;
            padding: 40px;
        }
    </style>
</head>
<body>
    <header class="header">
        <nav class="nav">
            <div class="logo">🎬 管理员控制台</div>
            <div class="nav-links">
                <a href="/admin/dashboard">控制台</a>
                <a href="/admin/users">用户管理</a>
                <a href="/admin/rooms">放映厅管理</a>
                <a href="/admin/logs">系统日志</a>
            </div>
            <div class="user-info">
                <span th:text="'管理员：' + ${currentUser != null ? currentUser.username : '未登录'}">管理员</span>
                <a href="/auth/logout" class="btn btn-sm">退出登录</a>
            </div>
        </nav>
    </header>
    
    <div class="container">
        <div class="welcome-section">
            <h1>欢迎使用影院管理系统</h1>
            <p>系统运行正常，您可以通过下方功能模块管理电影院的各项业务</p>
        </div>
        <!-- 管理功能 -->
        <div class="management-section">
            <h2 class="section-title">管理功能</h2>
            <div class="management-grid">
                <div class="management-card">
                    <div class="management-icon">👥</div>
                    <div class="management-title">用户管理</div>
                    <div class="management-description">管理系统用户，查看用户信息，设置管理员权限</div>
                    <a href="/admin/users" class="btn">进入管理</a>
                </div>
                

                
                <div class="management-card">
                    <div class="management-icon">🏢</div>
                    <div class="management-title">放映厅管理</div>
                    <div class="management-description">管理放映厅信息，设置座位数量</div>
                    <a href="/admin/rooms" class="btn">进入管理</a>
                </div>
                
                <div class="management-card">
                    <div class="management-icon">📊</div>
                    <div class="management-title">系统日志</div>
                    <div class="management-description">查看系统操作日志，监控系统运行状态</div>
                    <a href="/admin/logs" class="btn">进入管理</a>
                </div>
            </div>
        </div>
        
        <!-- 最近活动 -->
        <div class="recent-activities">
            <h2 class="section-title">最近活动</h2>
            
            <div th:if="${recentLogs != null and !recentLogs.empty}">
                <ul class="activity-list">
                    <li th:each="log : ${recentLogs}" class="activity-item">
                        <div class="activity-content">
                            <div class="activity-title" th:text="${log.operation ?: '系统操作'}">操作描述</div>
                            <div class="activity-time" 
                                 th:text="${#temporals.format(log.logTime, 'yyyy-MM-dd HH:mm:ss')}">时间</div>
                        </div>
                        <div class="activity-type type-system" th:text="'INFO'">级别</div>
                    </li>
                </ul>
            </div>
            
            <div th:if="${recentLogs == null or recentLogs.empty}" class="no-data">
                <p>暂无最近活动记录</p>
            </div>
        </div>
    </div>
</body>
</html>